<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:atom="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss/10" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:oos="http://11870.com/api/oos" xmlns:gml="http://www.opengis.net/gml">
    <xsl:template match="/">
        <xsl:variable name="entry_counter" select="count(/atom:feed/atom:entry)"/>
        <places size="{$entry_counter}">
            <xsl:for-each select="/atom:feed/atom:entry">  
                <xsl:variable name="placeId">
                    <xsl:value-of select="oos:id"/>
                </xsl:variable>
                <place id="{$placeId}">
                    <name>
                        <xsl:value-of select="atom:title"/>
                    </name>
                    <summary>
                        <xsl:value-of select="atom:summary"/>
                    </summary>
                    <address>
                        <xsl:value-of select="oos:useraddress"/>
                    </address>
                    <telephone>
                        <xsl:value-of select="oos:telephone"/>
                    </telephone>
                    <url>
                        <xsl:value-of select="oos:url"/>
                    </url>
                    <position>
                        <xsl:value-of select="georss:where/gml:Point/gml:pos"/>
                    </position>
                    <locality>
                        <xsl:value-of select="oos:locality"/>
                    </locality>
                    <countryName>
                        <xsl:value-of select="oos:country"/>
                    </countryName>
                    <dependentlocality>
                        <xsl:value-of select="oos:dependentlocality"/>
                    </dependentlocality>
                    <subdependentlocality>
                        <xsl:value-of select="oos:subdependentlocality"/>
                    </subdependentlocality>
                    <administrativearea>
                        <xsl:value-of select="oos:administrativearea"/>
                    </administrativearea>
                    <subadministrativearea>
                        <xsl:value-of select="oos:subadministrativearea"/>
                    </subadministrativearea>
                    <xsl:for-each select="./category">
                        <category>
                            <xsl:value-of select="@label"/>
                        </category>
                    </xsl:for-each>
                </place>    
            </xsl:for-each>  
        </places>  
    </xsl:template>    
</xsl:stylesheet>
